#!/bin/bash

#echo $1
shell_path=`pwd`
cd $1
dir_path=`pwd`
prefix=$2
echo $dir_path

for file in `ls $dir_path`
   do
     if test -f $file
     then
        new_file=$prefix$file
        mv $dir_path/$file $dir_path/$new_file
        echo "mv $file to $new_file"
     fi
     if test -d $file
     then
        new_dir=$dir_path/$file
        cd $shell_path
        sh $shell_path/prefix.sh $new_dir $prefix
        cd $dir_path
     fi
   done